extends CardState

#定义一个没有被放置的布尔变量，若没有放置到碰撞区，则置为true
var played: bool

#进入release后立即判定是否在碰撞区域，先执行enter()获取到是否CardUI在碰撞区，然后在input()中根据其布尔值来决定是否切换回BASE状态
func enter() -> void:
	#这句代码的意思是若targets不为空，则进入RELEASED状态后不再改变
	#若为空，则切换为BASE状态
	played = false
	if not card_ui.targets.is_empty():
		played = true
		card_ui.play()
		
func on_input(_event: InputEvent) -> void:
	if played:
		return
	transition_requested.emit(self, CardState.State.BASE)
	


